package me.zhengjie.inter.rest;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import me.zhengjie.business.service.AdlXmxxService;
import me.zhengjie.business.service.dto.AdlXmQueryCriteria;
import me.zhengjie.utils.PageUtil;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author xiahongbo
 * @date 2022-07-10
 **/
@RestController
@RequiredArgsConstructor
@Api(tags = "移动端ADL量表")
@RequestMapping("/mp/adl")
public class MpAdlController {

    private final AdlXmxxService adlXmxxService;

    @GetMapping(value = "/adlXmxxTree")
    @ApiOperation("查询ADL量表树")
    public ResponseEntity<Object> queryAdlXmxxTree(String adlPcId) {
        Map<String, Object> map = adlXmxxService.adlXmxxTree(adlPcId);
        return new ResponseEntity<>(PageUtil.toMpContent(map), HttpStatus.OK);
    }

    @GetMapping(value = "/randomAdlXmxxTree")
    @ApiOperation("查询随机ADL量表树")
    public ResponseEntity<Object> randomAdlXmxxTree(String adlPcId) {
        Map<String, Object> map = adlXmxxService.randomAdlXmxxTree(adlPcId);
        return new ResponseEntity<>(PageUtil.toMpContent(map), HttpStatus.OK);
    }
}
